package com.neuedu.javase.serializable;

import java.io.Serializable;

/***
 * 项目名称:  MyJavaSE 
 * 包：  com.neuedu.javase.serializable 
 * date:   2025/11/6   9:37  
 * 描述:  
 *  @author : 张金山
 *  作者博客:   https://blog.fulfill.com.cn
 */
public class Teacher implements Serializable {
    private String name;
    private Integer age;
    private double salary;
    private String address;

    //密码 transient 表示 序列化的时候 不应该保存我的密码
    private transient String password;


    private static final long serialVersionUID = -6773472139020270906L;


    //无参NoArgsConstructor
    public Teacher() {
    }

    // 全参 AllArgsConstructor
    public Teacher(String name, Integer age, double salary) {
        this.name = name;
        this.age = age;
        this.salary = salary;
    }


    public Teacher(String name, Integer age, double salary, String address, String password) {
        this.name = name;
        this.age = age;
        this.salary = salary;
        this.address = address;
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", salary=" + salary +
                ", address='" + address + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
